/**
 * 
 */
package hihocoder;

import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 矩阵游戏II {
	public static int getSum(int[] cols) {
		PriorityQueue<Integer> queue = new PriorityQueue<>();
		for (int i = 0; i < cols.length; i++) {
			queue.add(cols[i]);
		}
		while (true) {
			// 拿出两个最小的
			int val1 = queue.poll();
			int val2 = queue.poll();
			if (val1 + val2 < 0) {
				val1 = -val1;
				val2 = -val2;
				queue.add(val1);
				queue.add(val2);
			} else {
				queue.add(val1);
				queue.add(val2);
				break;
			}
		}
		int sum = 0;
		while (!queue.isEmpty()) {
			sum += queue.poll();
		}
		return sum;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		// 方阵
		int[][] A = new int[n][n];
		int[] cols = new int[n];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				A[i][j] = scanner.nextInt();
			}
		}
		scanner.close();
		// 统计每一列的和
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				cols[j] += A[i][j];
			}
		}
		// Arrays.sort(cols);
		// int i = 0;
		// while (i < n - 1) {
		// if (cols[i] + cols[i + 1] < 0) {
		// cols[i] = -cols[i];
		// cols[i + 1] = -cols[i + 1];
		// } else {
		// break;
		// }
		// }
		// int total = 0;
		// for (int j = 0; j < cols.length; j++) {
		// total += cols[j];
		// }
		// System.out.println(total);
		System.out.println(getSum(cols));
	}

}
